package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oceanread.cn.entity.Photography;
import com.oceanread.cn.entity.Treelist2;
import com.oceanread.cn.mapper.PhotographyMapper;
import com.oceanread.cn.mapper.Treelist2Mapper;
import com.oceanread.cn.service.IPhotographyService;
import com.oceanread.cn.service.ITreelist2Service;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IPhotographyServiceImpl extends ServiceImpl<PhotographyMapper, Photography> implements IPhotographyService {
    public List<Photography> getall() {
        return baseMapper.getall();
    }

    public List<Photography> query(String key, String value) {
        return baseMapper.query(key, value);
    }

    @Override
    public List<Photography> getTablelist(int page, int size) {
        return baseMapper.getTablelist((page - 1) * size, size);
    }

    @Override
    public List<Photography> getTablelistquery(String key, String value, int page, int size) {
        return baseMapper.getTablelistquery(key, value, (page - 1) * size, size);
    }

    @Override
    public Integer getnum() {
        return baseMapper.getnum();
    }

    @Override
    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }

    @Override
    public Integer update(Photography photography) {
        return baseMapper.update(Integer.parseInt(photography.getSysid()) , photography.getpId(), photography.getId(),
                photography.getName(), photography.getPath(), photography.getType(),
                photography.getTyperoot(), photography.getOpen(),photography.getInfluencechild(),
                photography.getRegion(),photography.getX(),photography.getY(),photography.getCameraHight());
    }

    @Override
    public int insert(
            String pId,
            String id,
            String name,
            String path,
            String type,
            String typeroot,
            String open,
            String influencechild,
            String region,
            String X,
            String Y,
            String CameraHight
    ) {
        return baseMapper.insert(
                 pId,
                 id,
                 name,
                 path,
                 type,
                 typeroot,
                 open,
                 influencechild,
                 region,
                 X,
                 Y,
                 CameraHight
        );
    }

    public Integer delete(int sysid) {
        return baseMapper.delete(sysid);
    }

}
